import http from "@/api";

/**
 * @name 房间管理模块
 */
// 获取房间列表
export const getRoomList = (params = {}) => {
  return http.post(`/room/query`, params, { noLoading: true });
};
// 获取房间详情
export const getRoomDtl = (params: { roomId: string }) => {
  return http.post(`/room/one`, params);
};
// 新增房间
export const addRoom = (params = {}) => {
  return http.post(`/room/create`, params, { noLoading: true });
};
// 编辑房间
export const editRoom = (params: { roomId: string }) => {
  return http.post(`/room/update`, params, { noLoading: true });
};

// 删除房间
export const deleteRoom = (params: { roomId: string }) => {
  return http.post(`/room/delete`, params);
};

// 酒店选择列表
export const getHotelSelList = (params = {}) => {
  return http.get(`/lookup/hotels`, params, { noLoading: true });
};

// 网关选择列表
export const getGatewaySelList = (params = {}) => {
  return http.get(`/lookup/gateways`, params, { noLoading: true });
};

/**
 * 删除用户锁地图树节点
 * @param params
 */
export const addRoomMap = (params = {}) => {
  return http.post(`/room-map/create`, params, { noLoading: true });
};

/**
 * 删除用户锁地图树节点
 * @param params
 */
export const editRoomMap = (params = {}) => {
  return http.post(`/room-map/update`, params, { noLoading: true });
};

/**
 * 删除用户锁地图树节点
 * @param params
 */
export const delRoomMap = (params = {}) => {
  return http.post(`/room-map/delete`, params, { noLoading: true });
};

/**
 * 上传锁地图节点照片
 * @param params
 */
export const uploadPhoto = (params = {}) => {
  return http.post(`/room-map/upload`, params, {
    noLoading: true,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};

// 导入房间
export const uploadExcle = (params: { excel: File }) => {
  return http.download(`room/import`, params, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
